using System;
using System.Collections.Generic;
using System.Text;

namespace Space
{
    /// <summary>
    /// Koordinata je osnovna osobina svih objekata u svemiru
    /// </summary>
    public class Coordinate
    {
        #region Properties

        // X koordinata
        private int x = 0;
        public int X
        {
            get { return x; }
            set { x = value; }
        }

        // Y koordinata
        private int y = 0;
        public int Y
        {
            get { return y; }
            set { Y = value; }
        }

        // Z koordinata
        private int z = 0;
        public int Z
        {
            get { return z; }
            set { z = value; }
        }

        // Lista objekata koji se nalaze na toj koordinati
        private List<ISpaceObject> content = null;
        public List<ISpaceObject> Content
        {
            get { return content; }
        }

        #endregion

        #region Construction

        public Coordinate()
        {
            content = new List<ISpaceObject>();
        }

        public Coordinate(int x, int y, int z)
        {
            this.x = x;
            this.y = y;
            this.z = z;

            content = new List<ISpaceObject>();
        }

        #endregion

        #region Methods

        // Dodaje novi objekat na koordinatu
        public void AddObject(ISpaceObject so)
        {
            content.Add(so);
        }

        // uklanja objekat sa koordinate
        public void RemoveObject(ISpaceObject so)
        {
            content.Remove(so);
        }

        #endregion

        #region Overrides

        public override string ToString()
        {
            return x.ToString() + ";" + y.ToString() + ";" + z.ToString();
        }

        #endregion
    }
}
